import request from '@/utils/request'


export function articleFind(params) {
  return request({
    url: `/cms/article/find`,
    method: 'get',
	params
  })
}

export function articleAdd(data) {
  return request({
    url: `/cms/article/add`,
    method: 'post',
	data
  })
}

export function articleRemove(data) {
  return request({
    url: `/cms/article/remove?ids=${data}`,
    method: 'get',
  })
}

export function articleDetail(data) {
  return request({
    url: `/cms/article/findArticledetail?id=${data}`,
    method: 'get',
  })
}


export function articleEdit(data) {
  return request({
    url: `/cms/article/edit`,
    method: 'post',
	data
  })
}

export function articleBatchPublish(data) {
  return request({
    url: `/cms/article/batchPublish?ids=${data}`,
    method: 'get',
  })
}

// 附件
// 删除附件
export function articleRemoveFile(id) {
  return request({
    url: `/cms/file/removeFile`,
    method: 'get',
    params:{
      id
    }
  })
}

// 预览附件
export function articleDownloadFile(id) {
  return request({
    url: `/cms/file/downloadFile`,
    method: 'get',
    params:{
      id
    }
  })
}
// 下载附件
export function articleShowFileByte(id) {
  return request({
    url: `/cms/file/showFileByte`,
    method: 'get',
    params:{
      id
    }
  })
}

// 查看附件
export function articleFindFileList(id) {
  return request({
    url: `/cms/file/findFileList`,
    method: 'get',
    params:{
      id
    }
  })
}

// 查看附件
export function articleSaveEcho () {
  return request({
    url: `/cms/article/findArticleLastAddDetail`,
    method: 'get'
  })
}
